package cn.com.surker.production.entity;

import cn.com.surker.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 生产运输油价表
 * </p>
 *
 * @author admin
 * @since 2024-12-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class ProductionOilPrice extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 标识
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 公司ID
     */
    private Long orgId;

    /**
     * 生产运输合同ID
     */
    private Long contractId;

    /**
     * 运输供应商ID
     */
    private Long supplierId;

    /**
     * 生效时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date takeTime;

    /**
     * 油价月份
     */
    private String today;

    /**
     * 车辆类型(0:轻量化1:中车2:大车)
     */
    private Integer carModel;

    /**
     * 月平均价
     */
    private Double avgPrice;
    /**
     * 最小运距
     */
    private Double minDistance;
    /**
     * 最大运距
     */
    private Double maxDistance;

    /**
     * 基础价
     */
    private Double basePrice;

    /**
     * 末位取数类型(0:四舍五入,1:小数末位向下取整,2:末位去小数取整)
     */
    private Integer roundType;

    /**
     * 计算系数(%)
     */
    private Double calcRate;

    /**
     * 调整价=（平均价-基础价）/计算系统
     */
    private Double adjustPrice;

    public ProductionOilPrice(){}

    public ProductionOilPrice(Long orgId, Long contractId, Long supplierId, Date takeTime, String today, Integer carModel, Double avgPrice, Double basePrice, Double calcRate, Double adjustPrice) {
        this.orgId = orgId;
        this.contractId = contractId;
        this.supplierId = supplierId;
        this.takeTime = takeTime;
        this.today = today;
        this.carModel = carModel;
        this.avgPrice = avgPrice;
        this.basePrice = basePrice;
        this.calcRate = calcRate;
        this.adjustPrice = adjustPrice;
    }
}
